<?php
$edit_id = md5(time().mt_rand(0, 10000));
?>

<h2 class="contentTitle" style="margin-bottom:0px;">添加链接</h2>
<div class="page">
  <div class="pageContent" layouth="31">
    <form method="post" action="<?php echo Yii::app()->request->requestUri?>" class="pageForm required-validate" onsubmit="return iframeCallback(this, navTabAjaxDone)" enctype="multipart/form-data">
      <div class="mypageFormContent" style="clear:both;margin-left:24px;padding:8px 0px;">
        <input type="hidden" name="navTabId" value="article_add" />
        <table>
          <tr>
            <th style="width:120px;">文章分类：</th>
            <td style="padding:8px;">
            <select name="category_id">
            <?php foreach ($category as $row):?>
            <option value="<?php echo $row->id?>"><?php echo $row->name?></option>
            <?php endforeach;?>
            </select>
            </td>
          </tr>
          <tr>
            <th style="width:80px;">链接名称：</th>
            <td style="padding:8px;"><input type="text" name="title" size="30" class="required textInput" /></td>
          </tr>
          <tr>
            <th style="width:80px;">链接地址：</th>
            <td style="padding:8px;"><input type="text" name="url" size="30" class="required textInput" /></td>
          </tr>
          <tr>
		  <tr>
            <th style="width:80px;">描述：</th>
            <td style="padding:8px;"><textarea name="description" cols="30" class="required textInput" /></textarea></td>
          </tr>
          <tr>
            <th style="width:80px;">图片：</th>
            <td style="padding:8px;"><input type="file" name="photo" size="30" /></td>
          </tr>
          <tr>
            <th style="width:80px;">新窗口打开链接：</th>
            <td style="padding:8px;"><input type="checkbox" value="1" name="new_window" /></td>
          </tr>
          <tr>
            <th style="width:80px;"></th>
            <td><div class="buttonActive"><div class="buttonContent"><button type="submit">&nbsp;&nbsp;提交&nbsp;&nbsp;</button></div></div></td>
          </tr>
        </table>
      </div>
    </form>
  </div>
</div>

<script type="text/javascript">
//<![CDATA[
CKEDITOR.replace( '<?php echo $edit_id?>',
{
	filebrowserBrowseUrl : '/static/ckfinder/ckfinder.html',
	filebrowserImageBrowseUrl : '/static/ckfinder/ckfinder.html?type=Images',
	filebrowserFlashBrowseUrl : '/static/ckfinder/ckfinder.html?type=Flash',
	filebrowserUploadUrl : '/static/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
	filebrowserImageUploadUrl : '/static/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
	filebrowserFlashUploadUrl : '/static/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash',
	filebrowserWindowWidth : '1000',
	filebrowserWindowHeight : '700'
});
//]]>
</script>